import {Observable} from '../dist/index.esm.js'

const observable = new Observable((subscribe)=>{
  subscribe.next(1)
  subscribe.next(2)
  subscribe.error('error')
  subscribe.next(3)
  subscribe.complete()
  subscribe.next(4)
})

const observer = {
  next:(value)=>console.log(value),
  error:(err)=>console.log(err),
  complete:()=>console.log('done')
}
observable.subscribe(observer) 

const observalbe2 = new Observable((sub)=>{
  sub.next("2->1")
})

observalbe2.subscribe((value)=>console.log(value))